I. Field of the Invention
The present invention relates to image processing and compression. More specifically, the present invention relates to a coding of DCT coefficients using Golomb-Rice.
II. Description of the Related Art
Digital picture processing has a prominent position in the general discipline of digital signal processing. The importance of human visual perception has encouraged tremendous interest and advances in the art and science of digital picture processing. In the field of transmission and reception of video signals, such as those used for projecting films or movies, various improvements are being made to image compression techniques. Many of the current and proposed video systems make use of digital encoding techniques. Aspects of this field include image coding, image restoration, and image feature selection. Image coding represents the attempts to transmit pictures of digital communication channels in an efficient manner, making use of as few bits as possible to minimize the band width required, while at the same time, maintaining distortions within certain limits. Image restoration represents efforts to recover the true image of the object. The coded image being transmitted over a communication channel may have been distorted by various factors. Source of degradation may have arisen originally in creating the image from the object. Feature selection refers to the selection of certain attributes of the picture. Such attributes may be required in the recognition, classification, and decision in a wider context.
Digital encoding of video, such as that in digital cinema, is an area that benefits from improved image compression techniques. Digital image compression may be generally classified into two categories: loss-less and lossy methods. A loss-less image is recovered without any loss of information. A lossy method involves an irrecoverable loss of some information, depending upon the compression ratio, the quality of the compression algorithm, and the implementation of the algorithm. Generally, lossy compression approaches are considered to obtain the compression ratios desired for a cost-effective digital cinema approach. To achieve digital cinema quality levels, the compression approach should provide a visually loss-less level of performance. As such, although there is a mathematical loss of information as a result of the compression process, the image distortion caused by this loss should be imperceptible to a viewer under normal viewing conditions.
Existing digital image compression technologies have been developed for other applications, namely for television systems. Such technologies have made design compromises appropriate for the intended application, but do not meet the quality requirements needed for cinema presentation.
Digital cinema compression technology should provide the visual quality that a moviegoer has previously experienced. Ideally, the visual quality of digital cinema should attempt to exceed that of a high-quality release print film. At the same time, the compression technique should have high coding efficiency to be practical. As defined herein, coding efficiency refers to the bit rate needed for the compressed image quality to meet a certain qualitative level. Moreover, the system and coding technique should have built-in flexibility to accommodate different formats and should be cost effective; that is, a small-sized and efficient decoder or encoder process.
Many compression techniques available offer significant levels of compression, but result in a degradation of the quality of the video signal. Typically, techniques for transferring compressed information require the compressed information to be transferred at a constant bit rate.
One compression technique capable of offering significant levels of compression while preserving the desired level of quality for video signals utilizes adaptively sized blocks and sub-blocks of encoded Discrete Cosine Transform (DCT) coefficient data. This technique will hereinafter be referred to as the Adaptive Block Size Discrete Cosine Transform (ABSDCT) method. This technique is disclosed in U.S. Pat. No. 5,021,891, entitled xe2x80x9cAdaptive Block Size Image Compression Method And System,xe2x80x9d assigned to the assignee of the present invention and incorporated herein by reference.
DCT techniques are also disclosed in U.S. Pat. No. 5,107,345, entitled xe2x80x9cAdaptive Block Size Image Compression Method And System,xe2x80x9d assigned to the assignee of the present invention and incorporated herein by reference. Further, the use of the ABSDCT technique in combination with a Differential Quadtree Transform technique is discussed in U.S. Pat. No. 5,452,104, entitled xe2x80x9cAdaptive Block Size Image Compression Method And System,xe2x80x9d also assigned to the assignee of the present invention and incorporated herein by reference. The systems disclosed in these patents utilize what is referred to as xe2x80x9cintra-framexe2x80x9d encoding, where each frame of image data is encoded without regard to the content of any other frame. Using the ABSDCT technique, the achievable data rate may be reduced from around 1.5 billion bits per second to approximately 50 million bits per second without discernible degradation of the image quality.
The ABSDCT technique may be used to compress either a black and white or a color image or signal representing the image. The color input signal may be in a YIQ format, with Y being the luminance, or brightness, sample, and I and Q being the chrominance, or color, samples for each 4:4:4 or alternate format. Other known formats such as the YUV, YCbCr or RGB formats may also be used. Because of the low spatial sensitivity of the eye to color, most research has shown that a sub-sample of the color components by a factor of four in the horizontal and vertical directions is reasonable. Accordingly, a video signal may be represented by four luminance components and two chrominance components.
Using ABSDCT, a video signal will generally be segmented into blocks of pixels for processing. For each block, the luminance and chrominance components are passed to a block interleaver. For example, a 16xc3x9716 (pixel) block may be presented to the block interleaver, which orders or organizes the image samples within each 16xc3x9716 block to produce blocks and composite sub-blocks of data for discrete cosine transform (DCT) analysis. The DCT operator is one method of converting a time and spatial sampled signal to a frequency representation of the same signal. By converting to a frequency representation, the DCT techniques have been shown to allow for very high levels of compression, as quantizers can be designed to take advantage of the frequency distribution characteristics of an image. In a preferred embodiment, one 16xc3x9716 DCT is applied to a first ordering, four 8xc3x978 DCTs are applied to a second ordering, 16 4xc3x974 DCTs are applied to a third ordering, and 64 2xc3x972 DCTs are applied to a fourth ordering.
The DCT operation reduces the spatial redundancy inherent in the video source. After the DCT is performed, most of the video signal energy tends to be concentrated in a few DCT coefficients. An additional transform, the Differential Quad-Tree Transform (DQT), may be used to reduce the redundancy among the DCT coefficients.
For the 16xc3x9716 block and each sub-block, the DCT coefficient values and the DQT value (if the DQT is used) are analyzed to determine the number of bits required to encode the block or sub-block. Then, the block or the combination of sub-blocks that requires the least number of bits to encode is chosen to represent the image segment. For example, two 8xc3x978 sub-blocks, six 4xc3x974 sub-blocks, and eight 2xc3x972 sub-blocks may be chosen to represent the image segment.
The chosen block or combination of sub-blocks is then properly arranged in order into a 16xc3x9716 block. The DCT/DQT coefficient values may then undergo frequency weighting, quantization, and coding (such as variable length coding) in preparation for transmission. Although the ABSDCT technique described above performs remarkably well, it is computationally intensive. Thus, compact hardware implementation of the technique may be difficult.
Variable length coding has been accomplished in the form of run length and size. Other compression methods, such as Joint Photographic Experts Group (JPEG) or Moving Picture Experts Group (MPEG-2), use a standard zig-zag scanning method over the entire processed block size. Using ABSDCT, however, different block sizes are generated, based on the variance within blocks of data. Some coding methods, such as Huffman codes, consist of a run of zeros followed by a non-zero coefficient. Huffman codes, however, are more optimal when the probabilities of the source symbols are negative powers of two. However, in the case of the run-length/size pairs, the symbol probabilities are seldom negative powers of two.
Further, Huffman coding requires a code book of pre-computed code words to be stored. The size of the code book can be prohibitively large. Also, the longest code word may be prohibitively long. Hence, use of Huffman coding for the run-length/size pair symbols is not very efficient.
An apparatus and method to encode the run-lengths and amplitude of the quantized DCT coefficients in a lossless manner to achieve compression is described. Specifically, Golomb-Rice coding is used to encode both zero runs and non-zero amplitudes of the DCT coefficients after quantization. It is found that the use of a scheme taking advantage of an exponential distribution of data, such as Golomb-Rice coding, allows for higher coding efficiencies than alternate schemes.
The present invention is a quality based system and method of image compression that utilizes adaptively sized blocks and sub-blocks of Discrete Cosine Transform coefficient data and a quality based quantization scale factor. A block of pixel data is input to an encoder. The encoder comprises a block size assignment (BSA) element, which segments the input block of pixels for processing. The block size assignment is based on the variances of the input block and further subdivided blocks. In general, areas with larger variances are subdivided into smaller blocks, and areas with smaller variances are not be subdivided, provided the block and sub-block mean values fall into different predetermined ranges. Thus, first the variance threshold of a block is modified from its nominal value depending on its mean value, and then the variance of the block is compared with a threshold, and if the variance is greater than the threshold, then the block is subdivided.
The block size assignment is provided to a transform element, which transforms the pixel data into frequency domain data. The transform is performed only on the block and sub-blocks selected through block size assignment. The transform data then undergoes scaling through quantization and serialization. Quantization of the transform data is quantized based on an image quality metric, such as a scale factor that adjusts with respect to contrast, coefficient count, rate distortion, density of the block size assignments, and/or past scale factors. Serialization, such as zig-zag scanning, is based on creating the longest possible run lengths of the same value. The stream of data is then coded by a variable length coder in preparation for transmission. Coding based on an exponential distribution, such as Golomb-Rice encoding, is utilized. Specifically, for zero represented data, a zero run length is determined. A Golomb parameter is determined as a function of the zero run length. A quotient is encoded as a function of the zero run length and the Golomb parameter. A remainder is encoded as a function of the zero run length, the Golomb parameter and the quotient. The coded quotient and the coded remainder are concatenated. For non-zero represented data, the nonzero data is encoded as a function of the non-zero data value and the sign of the non-zero data value. The encoded data is sent through a transmission channel to a decoder, where the pixel data is reconstructed in preparation for display.
Accordingly, it is an aspect of an embodiment to not require apriori code generation.
It is another aspect of an embodiment to not require the use of an extensive code book to be stored.
It is another aspect of an embodiment to reduce the size needed for hardware implementation.
It is another aspect of an embodiment to achieve a high coding efficiency.
It is another aspect of an embodiment to take advantage of the exponential distribution of DCT data.